﻿using SlamDunk.CMS.Model.Base;
using SlamDunk.CMS.Model.ViewModel;

namespace SlamDunk.CMS.Model.DataModel
{
    /// <summary>
    /// 硕士分数线
    /// </summary>
    public class MasterScoreLine : BaseEntity
    {
        #region # 属性

        #region 省份 —— string Province
        /// <summary>
        /// 省份
        /// </summary>
        public string Province { get; set; }
        #endregion

        #region 年份 —— int Year
        /// <summary>
        /// 年份
        /// </summary>
        public int Year { get; set; }
        #endregion

        #region 专业 —— string Major
        /// <summary>
        /// 专业
        /// </summary>
        public string Major { get; set; }
        #endregion

        #region 类别代码 —— int Category
        /// <summary>
        /// 类别代码
        /// </summary>
        public int Category { get; set; }
        #endregion

        #region 总分 —— int SumScore
        /// <summary>
        /// 总分
        /// </summary>
        public int SumScore { get; set; }
        #endregion

        #region 政治英语 —— int PoliticsEnglish
        /// <summary>
        /// 政治英语
        /// </summary>
        public int PoliticsEnglish { get; set; }
        #endregion

        #region 业务综合 —— int BusiCompre
        /// <summary>
        /// 业务综合
        /// </summary>
        public int BusiCompre { get; set; }
        #endregion

        #region 录取人数 —— int? AdmitCount
        /// <summary>
        /// 录取人数
        /// </summary>
        public int? AdmitCount { get; set; }
        #endregion

        #endregion

        #region # 方法

        #region 转换为视图模型 —— MasterScoreLineView ToViewModel()
        /// <summary>
        /// 转换为视图模型
        /// </summary>
        /// <returns>视图模型对象</returns>
        public MasterScoreLineView ToViewModel()
        {
            return new MasterScoreLineView()
            {
                Id = this.Id,
                Province = this.Province,
                Year = this.Year,
                Major = this.Major,
                Category = this.Category,
                CategoryName = this.Category == 1 ? "统招" : "联考",
                SumScore = this.SumScore,
                PoliticsEnglish = this.PoliticsEnglish,
                BusiCompre = this.BusiCompre,
                AdmitCount = this.AdmitCount,
                AddTime = this.AddTime.ToString("yyyy-MM-dd HH:mm:ss")
            };
        }
        #endregion

        #endregion
    }
}
